cmake_minimum_required(VERSION 3.10)
project(test_ros)

set(CMAKE_CXX_STANDARD 11)

IF (WIN32)
    include_directories(include)
    MESSAGE(STATUS "Now is windows")
ELSEIF (UNIX)
    find_package(CURL REQUIRED)
    MESSAGE(STATUS "Now is UNIX-like OS's.")
ENDIF ()

add_executable(test_ros main.cpp
        utils/byte_buf.cpp
        utils/string_util.cpp
        registerPublisher.h
        utils/file.cpp utils/base_file.cpp
        utils/TcpSocket.cpp
        utils/AbstractSocket.cpp
        utils/string_case.cpp
        registerSubscriber.h requestTopic.h connect.h parser.h
        unregisterSubscriber.h)

IF (WIN32)
    MESSAGE(STATUS "Now is windows")
    target_link_libraries(test_ros -lws2_32
            ${PROJECT_SOURCE_DIR}/lib/libcurl.a
            ${PROJECT_SOURCE_DIR}/lib/libcurl.dll.a)
ELSEIF (UNIX)
    MESSAGE(STATUS "Now is UNIX-like OS's.")
    target_link_libraries(test_ros -lcurl)
ENDIF ()
